<?php echo $header; ?>
<style>
.center{
	padding: 10px 0 !important;
	vertical-align:center;
}
#blue:hover td {
    color: #000000;
}
#blue td {
    color: #D3D3D3;
}
.list tbody tr:hover td {
    background-color: #FFFFCB;
}
</style>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="box">
    <div class="heading">
      <h1><img src="catalog/view/theme/default/image/customer.png" alt="" height="30" width="30" style="margin-right:10px"/>Danh Sách Người Giới Thiệu</h1>
    </div>
    <div class="content">
		<div id="cus_detail" >
			<span style=""><img Onclick="Close1();" style="cursor:pointer;" src="catalog/view/theme/default/image/remove.png" alt="Close"/></span><br>
			<p>Thông tin chi tiết</p>		
			<p id="info_cus"></p>
		</div>
      <form action="" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr>
			  <td class="center">Mã thành viên</td> 
              <td class="center">Họ tên</td>  
			  <td class="center">Tiền đóng lần 1</td>
			  <td class="center">Tiền đóng lần 2</td>
			  <td class="center">Ngày Đóng</td>
			  <td class="center">Xem Thông Tin</td>
            </tr>
          </thead>
		  
         <tbody>		
		<?php if(!empty($customers)){ ?>
		 <?php foreach ($customers as $customer) { ?>
		  <tr>
			  <td id="madn" class="center"><?php echo $customer['madn']; ?></td>
			  <td class="center"><?php echo $customer['name']; ?></td>
			  <td class="center"><?php echo $customer['price']; ?></td>
			  <td class="center"><?php echo $customer['price2']; ?></td>
			  <td class="center"><?php echo $customer['date_added'];?></td>
			  <td class="center"><a onclick="GetCustomer('<?php echo $customer['madn']?>');">chi tiết</a></td>
		  </tr>
		  <?php }} ?>
         </tbody>
        </table>
		
      </form>
    </div>
  </div>
  
  <div class="box">
    <div class="heading">
      <h1>Danh Sách Người Giới Thiệu Chưa Active</h1>
    </div>
    <div class="content">
		<div id="cus_detail" >
			<span style=""><img Onclick="Close1();" style="cursor:pointer;" src="catalog/view/theme/default/image/remove.png" alt="Close"/></span><br>
			<p>Thông tin chi tiết</p>		
			<p id="info_cus"></p>
		</div>
      <form action="" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr>
			  <td class="center">Mã thành viên</td> 
              <td class="center">Họ tên</td>  
			  <td class="center">Tiền đóng lần 1</td>
			  <td class="center">Tiền đóng lần 2</td>
			  <td class="center">Ngày Đóng</td>
			  <td class="center">Xem Thông Tin</td>
            </tr>
          </thead>
		  
         <tbody>		
		<?php if(!empty($customers_notactive)){ ?>
		 <?php foreach ($customers_notactive as $customer) { ?>
		  <tr>
			  <td id="madn" class="center"><?php echo $customer['madn']; ?></td>
			  <td class="center"><?php echo $customer['name']; ?></td>
			  <td class="center"><?php echo $customer['price']; ?></td>
			  <td class="center"><?php echo $customer['price2']; ?></td>
			  <td class="center"><?php echo $customer['date_added'];?></td>
			  <td class="center"><a onclick="GetCustomer('<?php echo $customer['madn']?>');">chi tiết</a></td>
		  </tr>
		  <?php }} ?>
         </tbody>
        </table>
		
      </form>
    </div>
  </div>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
function Close1(){
	$('#cus_detail').slideUp();
}

function GetCustomer(madn){
	var user_nhan = madn
	$.ajax({
		url:  'index.php?route=account/user/GetCustomer',
		type: 'post',
		data: 'user_nhan=' + user_nhan,
		dataType: 'json',		
		beforeSend: function() {
			$('body').css('opacity', 0.5);
		},
		complete: function() {
			$('body').css('opacity', 1);
		},		
		success: function(json) {
			if(json['error']){
				alert(json['error']);
				$('#info_cus').html('');
			}
			if(json['success']){
				var html ='';
				html += '<br><span style="margin-right:25px;color:red">Mã số  </span><span id="madn" style="color:#000;">'+ json['success']['madn'] + '</span><br>';
				html += '<span style="margin-right:15px;color:red">Họ và tên </span><span id="madn" style="color:#000;">'+ json['success']['name'] + '</span><br>';
				html += '<span style="margin-right:15px;color:red">Số điện thoại </span><span id="madn" style="color:#000;">'+ json['success']['telephone'] + '</span><br>';
				html += '<span style="margin-right:15px;color:red">Địa chỉ </span><span id="madn" style="color:#000;">'+ json['success']['adress'] + '</span><br>';
				html += '<span style="margin-right:15px;color:red">Ngày sinh</span><span id="madn" style="color:#000;">'+ json['success']['born'] + '</span><br>';
				html += '<span style="margin-right:15px;color:red">Email</span><span id="madn" style="color:#000;">'+ json['success']['email'] + '</span><br>';
				html += '<span style="margin-right:15px;color:red">Cấp</span><span id="madn" style="color:#000;">'+ json['success']['level1'] + '</span><br>';
				
				$('#info_cus').html(html);
				$('#cus_detail').slideDown();
			}
			
			
		}
	});
}
//--></script>

<?php echo $footer; ?> 